﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;

namespace ZDSoft.TES.Entity.SystemEntity
{
    [ActiveRecord("SystemRole")]
    public class Role : EntityBase<Role>
    {
        /// <summary>
        /// 角色名称
        /// </summary>
        [Property]
        public string RoleName { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [Property]
        public bool IsActive { get; set; }

        [HasAndBelongsToMany(typeof(User), Table = "SystemUserRole", ColumnKey = "RoleID", ColumnRef = "UserID", Lazy=true)]
        public IList<User> Users { get; set; }

        [HasAndBelongsToMany(typeof(SystemFunction), Table = "SystemRoleFunction", ColumnKey = "RoleID", ColumnRef = "SystemFunctionID", Lazy = true)]
        public IList<SystemFunction> SystemFunctions { get; set; }
    }
}
